#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
int main() 
{
    char data[] = "John 25 175.5";
    char name[20];
    int age;
    float height;
    sscanf(data, "%s %d %f", name, &age, &height);
    // name = "John", age = 25, height = 175.5
    cout << name << endl; 
    cout << age << endl; 
    cout << height << endl; 
    
    char result[50];
    int value = 42;
    float pi = 3.1415;
    sprintf(result, "The value is: %d and Pi is: %.2f", value, pi);
    // result = "The value is: 42 and Pi is: 3.14"
    cout << result << endl;
    
    char source[] = "Hello";
    char destination[20];
    strcpy(destination, source);
    cout << destination << endl;
    
    char myString[] = "Hellolo";
    char *ptr = strchr(myString, 'l');
    cout << *ptr << endl;
    char *ptr1 = strstr(myString, "lo");
    cout << *ptr1 << endl;
    char *ptr2 = strrchr(myString, 'l');
    cout << *ptr2 << endl;
    return 0;
}

